SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwtcue
AS
SELECT    distinct   CONVERT(varchar, dbo.u_cue.idCue) + CONVERT(varchar, dbo.u_f2_00_varios.construccion) AS ID, dbo.u_cui.cui, dbo.u_jurisdiccion.jurisdiccion, dbo.u_segmento.segmento, dbo.u_cue.NomEst, dbo.u_lote.lote, 
                      dbo.u_f2_00_varios.construccion, dbo.u_cue.codCue, dbo.u_cue.ofertaEducModalidades, dbo.u_cue.ofertaEducNiveles, dbo.u_cue.turno, 
                      dbo.u_cue.calle, dbo.u_cue.numero, dbo.u_cue.referencia
FROM         dbo.u_f2_b_cue_usan_construccion INNER JOIN
                      dbo.u_cue ON dbo.u_f2_b_cue_usan_construccion.idCue = dbo.u_cue.idCue INNER JOIN
                      dbo.u_f2_00_varios ON dbo.u_f2_b_cue_usan_construccion.idConstruccion = dbo.u_f2_00_varios.Id INNER JOIN
                      dbo.u_cui INNER JOIN
                      dbo.u_jurisdiccion ON dbo.u_cui.idjurisdiccion = dbo.u_jurisdiccion.idJurisdiccion INNER JOIN
                      dbo.u_segmento ON dbo.u_cui.idSegmento = dbo.u_segmento.Id INNER JOIN
                      dbo.u_lote ON dbo.u_cui.idLote = dbo.u_lote.Id ON dbo.u_f2_00_varios.idCui = dbo.u_cui.Id


GO
GRANT SELECT ON  [dbo].[vwtcue] TO [Cenie]
GO
